package com.helloags;

import java.io.IOException;
import java.net.UnknownHostException;

import com.esri.arcgis.server.IServerObjectAdmin;
import com.esri.arcgis.server.IServerObjectConfiguration2;
import com.esri.arcgis.server.ServerConnection;
import com.esri.arcgis.system.IPropertySet;
import com.esri.arcgis.system.ServerInitializer;

public class GetProperties {

	/**
	 * @param args
	 * @throws IOException 
	 * @throws UnknownHostException 
	 */
	public static void main(String[] args) throws UnknownHostException, IOException {
		ServerInitializer si = new ServerInitializer();
        si.initializeServer("*", "zhushijie", "zsj123456");
        
        ServerConnection conn = new ServerConnection(); 
		conn.connect("192.168.3.106", "*", "zhushijie", "zsj123456");
		
		IServerObjectAdmin soa = conn.getServerObjectAdmin();
		IServerObjectConfiguration2 conf = (IServerObjectConfiguration2) soa.getConfiguration("search3", "MapServer");
//		IPropertySet pro = conf.getProperties();
		IPropertySet proKML = conf.getExtensionProperties("wcsServer");
		Object[] names = {new Object()};
		Object[] values = {new Object()};
		proKML.getAllProperties(names, values);
		
		System.out.println("Congratulaction!");
	}

}
